<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta name="format-detection" content="telephone=no" />
	<title>订单详情</title>
	<link rel="icon" href="<c:url value="/img/favicon.ico"/>"/>
	<link media="all" href="<c:url value="/css/base.css"/>" type="text/css" rel="stylesheet"/>
	<link media="all" href="<c:url value="/css/cart.css"/>" type="text/css" rel="stylesheet"/>
	<script src="<c:url value="/js/jquery-1.2.6.js"/>" type="text/javascript"></script>
	<script language="javascript" src="<c:url value="/js/config2.js"/>"></script>
	<script language="javascript" src="<c:url value="/js/common.js"/>"></script>
	<script language="javascript" src="<c:url value="/js/template.js"/>"></script>

</head>
<body>
	<script src="<c:url value="/js/base-v1.js"/>" type="text/javascript"></script>
	
	<script type="text/javascript">
		$(document).ready(function(){
			var customer = "${empty consignee}";
			if(customer == "false"){
				$("#part_consignee").removeClass("hideconsignee").addClass("showconsignee");
			}else{
				$("#edit_consignee").removeClass("hideconsignee").addClass("showconsignee");
			}
		});
		
	</script>
	
	<jsp:include page="/jsp/shortcut.jsp" />

	<div class="cart-header w">
		<div class="logo">
			<a href="<c:url value="/category/home.html"/>" rel="nofollow">
				<img src="<c:url value="/img/logo.png"/>" height="50" width="176" />
			</a>
		</div>
		<div class="progress pro-2">
			<ul>
				<li class="step-1">购物车</li>
				<li class="step-2">订单详情</li>
				<li class="step-3">提交订单</li>
			</ul>
		</div>
		<div class="company">
			<img src="http://static.360buyimg.com/ept/cart/img/company1.png" height="37" width="68" />
			<img src="http://static.360buyimg.com/ept/cart/img/company2.png" height="37" width="68" />
		</div>
	</div>

	<div class="cart w">
		<div id="show">
			
			<div id="order_jst">
				<div class="cart-list">
					<div class="title">
						<a href="<c:url value="/cart/getCart.action"/>">
							继续编辑购物车
						</a>
					</div>
					<div class="cart-com">
						<div class="mt">
							收货信息 
							<span class="shipping-info">(如果您选择邮件寄送，请填写正确的收货地址)</span>
						</div>
						
						<div id="part_consignee" class="hideconsignee">
							<div class="mc" id="read_consignee">
								<div class="mct1">收货人:</div>
								<div class="mcc1" id="yournameDiv">${consignee.name }</div>
								<div class="mct1">收货地址:</div>
								<div class="mcc1">${consignee.address }</div>
								<div class="mct1">市/区:</div>
								<div class="mcc1">${consignee.city }</div>
								<div class="mct1">国家/地区:</div>
								<div class="mcc1">${consignee.country }</div>
								<div class="mct1">省/市/自治区:</div>
								<div class="mcc1">${consignee.province }</div>
								<div class="mct1">邮政编码:</div>
								<div class="mcc1">${consignee.postCode }</div>
								<div class="mct1">收件人电话:</div>
								<div class="mcc1">${consignee.phone }</div>
								<div class="mct1">收件人邮箱:</div>
								<div class="mcc1">${consignee.email }</div>
								<div class="mct2"></div>
								<div class="mcc2">
									<input type="button" class="btn-add1" value="Update" onclick="Edit_Consignee(this)"/>
								</div>
		
							</div>
						</div>
						
						<div id="edit_consignee" class="hideconsignee">
							<div class="mc">
								<div class="mct">
									<em>*</em>收货人:
								</div>
								<div class="mcc">
									<c:choose>
										<c:when test="${consignee == null || consignee.name == null }">
											<input type="text" class="cinp cinp1 f-grey" value="请输入收货人姓名" onfocus="clearTemp(this)"
												onblur="check_name()" name="consignee_name"/>
										</c:when>
										<c:otherwise>
											<input type="text" class="cinp cinp1" value="${consignee.name}" onblur="check_name()"
												name="consignee_name"/>
										</c:otherwise>
									</c:choose>
									
								</div>
								<div class="mct">
									<em>*</em>国家/地区:
								</div>
								<div class="mcc" id="div_Country">
									<select class="cinp cinp3" onchange="changeCountry(this)" id="consignee_country">
										<option value="-22">请选择</option>
										<option value="3" countryname="中国" countrycode="+86" shortname="CN">中国</option>
									</select>
								</div>
								<div class="mct">
									<em>*</em>省/市/自治区:
								</div>
								<div class="mcc" id="div_State">
									<select class="cinp cinp3" onchange="changeState(this)" id="consignee_state">
										<option value="-22">请选择</option>
									</select>
								</div>
								<div class="mct">
									<em>*</em>市/区:
								</div>
								<div class="mcc">
									<input type="text" class="cinp cinp2" onblur="check_city()" 
										value="${consignee.city == null ? null : consignee.city }" id="consignee_city" />
								</div>
								<div class="mct">
									<em>*</em>收货地址:
								</div>
								<div class="mcc">
									<input type="text" class="cinp cinp2" onblur="check_address()" 
										value="${consignee.address == null ? null : consignee.address }" id="consignee_address" />
								</div>
								<div class="mct">
									<em>*</em>邮政编码:
								</div>
								<div class="mcc" id="div_Postcode">
									<input type="text" class="cinp cinp2" onblur="check_postcode()" 
										value="${consignee.postCode == null ? null : consignee.postCode }" id="consignee_postcode" />
									<span>例如：310023</span>
								</div>
								<div class="mct">
									<em>*</em>邮箱:
								</div>
								<div class="mcc" id="div_Email">
									<input type="text" class="cinp cinp2" onblur="check_email()" 
										value="${consignee.email == null ? null : consignee.email }" id="consignee_email" />
								</div>
								<div class="mct">
									<em>*</em>收货人电话：
								</div>
								<div class="mcc">
									<span id="consignee_countryCode" class="tips7">+086-</span>
									<input type="text" class="cinp cinp2" onblur="check_phone()" 
										value="${consignee.phone == null ? null : consignee.phone }" id="consignee_phone" />
									<span>例如：+86-13333333333</span>
								</div>
					
								<div class="mct"></div>
								<div class="mcc">
									<input type="button" class="btn-add1" value="保存收货地址" onclick="savePart_consignee()" id="saveConsigneeInfo"/>
									<span
										class="tips11">带 <em>*</em> 的为 必填字段
									</span>
								</div>
					
					
							</div>
						</div>
						
						<div id="shipTextAreaHide">
							<div class="mt">配送方式
						    	<span class="shipping-info">（保障配送过程的安全）</span>
							</div>
						    
						    <div class="mc">
						        <div class="table" style="position: relative;">
						            <table cellspacing="0" cellpadding="0" width="100%">
						                <tbody>
							                <tr>
							                    <td>
							                    	<input type="radio" name="shippingType" onclick="showPrice('FTP 下载', '0', '0', '0');" value="ftp" />
							                    </td>
							                    <td>FTP 下载</td>
							                    <td>
							                    	
							                    </td>
							                    <td style="width: 210px; text-align: left">
							                    	<strong>￥ 0.00元 </strong>
							                    	<span style="color: red">(节省 10.00元)</span>
							                    </td>
							                </tr>
											<tr>
											   <td>
											   	<input type="radio" name="shippingType" onclick="showPrice('光盘快递', '10', '0', '0');" value="cd" />
											   </td>
											   <td>光盘快递</td>
											   <td>
											   	
											   </td>
											   <td style="width: 210px; text-align: left">
											   	<strong>￥ 10.00元 </strong>
											   	<span style="color: red">(节省 10.00元)</span>
											    </td>
											</tr>
						                </tbody>
						            </table>
						        </div>
						        <div class="more">
						            <strong>注意事项：</strong><br />
						            1.&nbsp;提交的订单在确认发货之前都可以被取消！ <br />
						            2.&nbsp;超过7天未付款的订单会自动取消！
						            <!--<a href="#">Learn more </a>-->
						        </div>
						        <div class="m">
										<img height="111" width="888" src="http://static.360buyimg.com/ept/cart/img/cart.bg.jpg"/>
									</div>
						    </div>
						</div>
		
						<div class="mt">付款方式</div>
						<div class="mc">
		
							<div class="item item-f">
								<input type="radio" class="radio" id="paypalSel" checked="checked" name="payType" value="alipay"/>
									<span class="fore">支付宝</span>
										支付宝用户可使用支付宝账号进行支付 
							</div>
							
						</div>
						<!--Cart信息开始-->
						<div id="part_cart">
							<div class="mt">你的商品</div>
						    <div class="mc">
						        <div class="cart-thead1">
						            <div class="column t-goods">商品</div>
						            <div class="column t-price">价格</div>
						            <div class="column t-other">数量</div>
						            <div class="column t-other">总价</div>
						
						        </div>
						        <div class="cart-tbody1">
						            <!-- 显示主商品 -->
						            <c:forEach var="items" items="${items }" varStatus="status">
						            	<c:set var="total" value="${total + items.price }"/>
						            	<div class="cart-item1">
											<div class="cell p-goods">
												<div class="pic">
													<img width="100px" height="100px" src="<c:url value="/image/getImage.action/${items.imageId }"/>" />
												</div>
												<div class="name">
													<a href="" target="_blank">${items.title}</a>
												
													<%-- <div>
														<span><font color='red'>${items.price}</font></span>
															${sku.name}
														<font color='red'>×${sku.num}</font>
													</div> --%>
												     
												</div>
											</div>
											<div class="cell p-price">
											    <span>￥ ${items.price }</span>
											</div>
											<div class="cell p-quantity">
											    ${items.count }
											</div>
						                	<div class="cell p-price1">￥ ${items.price * items.count }</div>
						                	<span class="clr"></span>
						            	</div>
						            </c:forEach>

						        </div>
						    </div>
						</div>
						<!--Cart信息结束-->
						<div class="mt">赠券</div>
						<div class="mc">
							<div class="item" id="couponDiv">
								<span>请输入赠券号码：</span>
								<input type="text" value='${order.eptCoupon.code}' id="useDiscountCodeText" class="cinp cinp2" name="coupon_code"/>
								<input type="button" class="btn-add" onclick="add_Coupon_ept($(this).prev().val())" name='add_coupon_button' value="提交"/>
								<b onclick="clearCouponEPT(this)">X</b>
							</div>
						</div>
					</div>
					<div class="place">
						<ul>
							<li>
								<span class="one">商品总计 (<b id="itemsNum"></b>&nbsp;件): </span>
								<label id="subtotalLable">￥ ${total }元</label>
							</li>
							<li>
								<span class="one">运费： </span>
								<label id="shipLable">￥ 0.00元</label>
							</li>
							<li>
								<span class="one">折扣：</span>
								<label id="discountLable">￥ 0.00元</label></li>
							<li>
								<span class="one">价格总计: </span>
								<label class="all" id="totalLable">￥ ${total }元</label>
							</li>
							<li>
								<a href="javascript:void(0);" onclick="submitOrder();" id="submitWaitInfo"></a>
							</li>
						</ul>
						<div class="tips8">
							我们保障每个订单的安全和每个用户的信息。
						</div>
					</div>
		
				</div>
				<span class="clr"></span>
			</div>
		
					
		</div>
	</div>

	<div id="hiddenInput">
		<input type="hidden" id="Consignee_Hidden_Type" value="${consignee == null ? 0 : 1 }" />
	</div>


	<jsp:include page="/jsp/bottom.jsp"/>

	<script language="javascript" src="<c:url value="/js/orderEPT.js"/>"></script>
	<script src="<c:url value="/js/lib-v1.js"/>" type="text/javascript"> </script>



</body>
</html>
